package com.kaibes.core.validator;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

@Documented
@Constraint(validatedBy = {NotBlankButNullValidator.class})
@Target(FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface NotBlankButNull {
    String message() default "不能为空";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

    @Target(FIELD)
    @Retention(RUNTIME)
    @Documented
    public @interface List {
        NotBlankButNull[] value();
    }
}
